<template>
  <div>
    <van-config-provider :theme-vars="themeVars">
      <RouterView />
      <van-floating-bubble
        style="top: -50px;" 
        axis="lock" 
        icon="service-o"
        @click="open(serverUrl)"
        v-if="show"
      />
      <TabBar />
    </van-config-provider>
  </div>
</template>

<script setup lang="ts">
import TabBar from "@/components/Tabbar/index.vue"

import { useUserStore } from "@/store/user"

import { RouterView, useRoute } from 'vue-router'

import { open } from "@/utils/index"

const route = useRoute()

const user = useUserStore()

const serverUrl = user.config ? user.config['customer.config.contactUrl'] : ''

const tabbarPath = ['/home', '/welfare', '/credit', '/user']

const show = computed(() => tabbarPath.includes(route.path))

const themeVars = {
  "nav-bar-icon-color": "#000",
  "nav-bar-title-text-color": "#000",
  "nav-bar-arrow-size": "20px",
  "tabs-bottom-bar-color": 'transparent',
  "dialog-confirm-button-text-color": "#000",
}
</script>


<style lang="less" scoped>
</style>
